package com.liuyang.demo.redis;

import com.liuyang.demo.redis.cache.RedisUtil;
import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.reactive.RedisReactiveCommands;
import io.lettuce.core.api.sync.RedisCommands;
import io.lettuce.core.api.sync.RedisStringCommands;
import io.lettuce.core.api.sync.RedisHashCommands;

import java.util.Map;
import java.util.Set;

public class BasicUsageDemo {
    public static void main(String[] args) {
        RedisClient client = RedisClient.create("redis://dev-cwi-redis:6379");
        StatefulRedisConnection<String, String> connection = client.connect();
        //RedisStringCommands sync = connection.sync();
        //String value = String.valueOf(sync.get("cwi:cms:login:error:"));
        RedisCommands<String, String> redis = connection.sync();
        //Map hgetall = sync.hgetall("cwi:cms:login:error:*");
        RedisReactiveCommands<String, String> reactive = redis.getStatefulConnection().reactive();

        //System.out.println(hgetall);
    }
    public static void t(){

        //RedisUtil redisUtil =new RedisUtil();
        //Set<Object> smembers = redisUtil.smembers("hmsd:user.punch:nutrition.sport:2021-03-12");
        //log.debug(smembers.toString());
        //String.valueOf(redisUtil.ttl("hmsd:user.punch:nutrition.sport:2021-03-12"))

    }
}
